package com.ktjy.config;


import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lqm
 * @ClassName PageHelperConfig
 * @description: TODO
 */
@Configuration
public class PageHelperConfig {
//
    @Bean
    public MybatisPlusInterceptor paginationInterceptor(){
        // 初始化 MybatisPlusInterceptor 核心插件
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        // 添加自动分页插件 PaginationInnerInterceptor
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        // 返回
        return interceptor;
    }


//    @Bean
//    public PaginationInnerInterceptor getPaginatioonInterceptor(){
//       return new PaginationInnerInterceptor();
//    }
}
